Skip to content

Added fee market components. - #653

Open
Randy808 wants to merge 1 commit into
Blockstream:masterfrom
Randy808:fee-market
Open

Added fee market components.#653
Randy808 wants to merge 1 commit into
Blockstream:masterfrom
Randy808:fee-market

Conversation

@Randy808

@Randy808 Randy808 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

To run locally, npm install and use the following snippets:

# Bitcoin
export API_URL=https://blockstream.info/api
export PORT=4999
source flavors/blockstream/config.env
source flavors/bitcoin-mainnet/config.env
npm run dev-server
# Liquid
export API_URL=https://blockstream.info/liquid/api
export PORT=5000
source flavors/blockstream/config.env
source flavors/liquid-mainnet/config.env
npm run dev-server

Bitcoin:
fee btc | Screenshot 2026-08-13 at 11 58 37 AM

Liquid:
fee lqd | Screenshot 2026-08-13 at 11 58 06 AM

@Randy808 Randy808 self-assigned this Aug 12, 2026
@Randy808
Randy808 marked this pull request as ready for review August 12, 2026 19:31
Comment thread client/src/lib/fees.js
const low = feeEst && feeEst[12]
, high = feeEst && feeEst[3]
const low = feeEst && feeEst[feeEstimateTargets.low]
, high = feeEst && feeEst[feeEstimateTargets.average]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You take feeEstimateTargets.average but marked it as hight. This could lead to misunderstandings in feature.

const feeEstimateTargets: {
    low: number;
    average: number;
    high: number;
}

Comment thread client/src/lib/market.js
Comment on lines +1 to +4
export const getBitcoinPrices = marketChart =>
((marketChart && marketChart.prices) || [])
.map(price => price && price[1])
.filter(Number.isFinite)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to add check for array value, and we can simplify code like marketChart && marketChart.prices to marketChart?.prices

export const getBitcoinPrices = marketChart =>
  (Array.isArray(marketChart?.prices) ? marketChart.prices : [])
    .map(price => price && price[1])
    .filter(Number.isFinite)

Comment on lines +45 to +46
value={formatFeeRate(feerate, unavailable)}
footer={formatUsd(feeUsd, unavailable)}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use default fallback instead of unavailable. The same in other places

Comment thread client/src/lib/fees.js
&& Number.isFinite(feerate) && feerate >= 0
? (bitcoinPrice / satoshisPerBitcoin) *
feerate *
averageNativeSegwitTransactionVsize

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We render this block for both networks.

On the Liquid Network, the concept of a "Native SegWit transaction" does not apply in the same way as on Bitcoin. Liquid uses a modified transaction architecture built on the Elements codebase, where default transfers are Confidential Transactions that bundle cryptographic range proofs and Pedersen commitments for privacy.

A standard single-input, dual-output Liquid transaction is significantly larger than a plain Bitcoin Native SegWit (P2WPKH) transaction - averaging roughly 1500 to 2000 bytes/vBytes instead of ~141 vBytes due to the mandatory inclusion of size-heavy range proofs (bulletproofs) that hide asset types and amounts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants